function get_brake_pattern_offset(limit_speed)
{
	return 0;
}

function get_incoming_pattern_offset(limit_speed)
{
	return 0;
}

function lookup_brake_pattern(limit_speed, accum_distance, target_distance, offset_distance)
{
	local brake_pattern_table = 
	{
		[0]=	10	,
		[1]=	10	,
		[2]=	10	,
		[3]=	10	,
		[4]=	10	,
		[5]=	10.47854952	,
		[6]=	11.47867588	,
		[7]=	12.39838699	,
		[8]=	13.25443322	,
		[9]=	14.05844942	,
		[10]=	14.81890684	,
		[11]=	15.54220062	,
		[12]=	16.23329911	,
		[13]=	16.89615341	,
		[14]=	17.53396704	,
		[15]=	18.14938015	,
		[16]=	18.74459922	,
		[17]=	19.32149063	,
		[18]=	19.88164983	,
		[19]=	20.42645344	,
		[20]=	20.95709904	,
		[21]=	21.4746362	,
		[22]=	21.9799909	,
		[23]=	22.47398496	,
		[24]=	22.95735176	,
		[25]=	23.43074903	,
		[26]=	23.8947693	,
		[27]=	24.34994867	,
		[28]=	24.79677398	,
		[29]=	25.23568901	,
		[30]=	25.66709956	,
		[31]=	26.09137789	,
		[32]=	26.50886644	,
		[33]=	26.91988113	,
		[34]=	27.32471409	,
		[35]=	27.72363613	,
		[36]=	28.11689883	,
		[37]=	28.50473645	,
		[38]=	28.88736748	,
		[39]=	29.26499616	,
		[40]=	29.63781368	,
		[41]=	30.0059994	,
		[42]=	30.36972176	,
		[43]=	30.72913927	,
		[44]=	31.08440123	,
		[45]=	31.43564855	,
		[46]=	31.78301433	,
		[47]=	32.12662447	,
		[48]=	32.46659822	,
		[49]=	32.80304864	,
		[50]=	33.13608305	,
		[51]=	33.46580344	,
		[52]=	33.79230682	,
		[53]=	34.11568554	,
		[54]=	34.43602765	,
		[55]=	34.7534171	,
		[56]=	35.06793407	,
		[57]=	35.37965517	,
		[58]=	35.68865366	,
		[59]=	35.99499965	,
		[60]=	36.29876031	,
		[61]=	36.6	,
		[62]=	36.89878047	,
		[63]=	37.19516098	,
		[64]=	37.48919844	,
		[65]=	37.78094758	,
		[66]=	38.07046099	,
		[67]=	38.3577893	,
		[68]=	38.64298125	,
		[69]=	38.9260838	,
		[70]=	39.20714221	,
		[71]=	39.48620012	,
		[72]=	39.76329966	,
		[73]=	40.03848149	,
		[74]=	40.31178488	,
		[75]=	40.58324778	,
		[76]=	40.85290687	,
		[77]=	41.12079766	,
		[78]=	41.38695447	,
		[79]=	41.65141054	,
		[80]=	41.91419807	,
		[81]=	42.17534825	,
		[82]=	42.4348913	,
		[83]=	42.69285655	,
		[84]=	42.9492724	,
		[85]=	43.20416647	,
		[86]=	43.45756551	,
		[87]=	43.70949554	,
		[88]=	43.9599818	,
		[89]=	44.20904885	,
		[90]=	44.45672053	,
		[91]=	44.70302003	,
		[92]=	44.94796992	,
		[93]=	45.19159214	,
		[94]=	45.43390804	,
		[95]=	45.67493842	,
		[96]=	45.91470353	,
		[97]=	46.15322307	,
		[98]=	46.39051627	,
		[99]=	46.62660185	,
		[100]=	46.86149806	,
		[101]=	47.09522269	,
		[102]=	47.3277931	,
		[103]=	47.55922623	,
		[104]=	47.7895386	,
		[105]=	48.01874634	,
		[106]=	48.24686518	,
		[107]=	48.47391051	,
		[108]=	48.69989733	,
		[109]=	48.92484032	,
		[110]=	49.1487538	,
		[111]=	49.37165179	,
		[112]=	49.59354797	,
		[113]=	49.81445573	,
		[114]=	50.03438817	,
		[115]=	50.2533581	,
		[116]=	50.47137803	,
		[117]=	50.68846023	,
		[118]=	50.90461669	,
		[119]=	51.11985915	,
		[120]=	51.33419913	,
		[121]=	51.54764786	,
		[122]=	51.76021638	,
		[123]=	51.97191549	,
		[124]=	52.18275577	,
		[125]=	52.39274759	,
		[126]=	52.60190111	,
		[127]=	52.81022628	,
		[128]=	53.01773288	,
		[129]=	53.22443048	,
		[130]=	53.43032847	,
		[131]=	53.63543605	,
		[132]=	53.83976226	,
		[133]=	54.04331596	,
		[134]=	54.24610585	,
		[135]=	54.44814046	,
		[136]=	54.64942818	,
		[137]=	54.84997721	,
		[138]=	55.04979564	,
		[139]=	55.24889139	,
		[140]=	55.44727225	,
		[141]=	55.64494586	,
		[142]=	55.84191974	,
		[143]=	56.03820126	,
		[144]=	56.23379767	,
		[145]=	56.42871609	,
		[146]=	56.62296354	,
		[147]=	56.81654689	,
		[148]=	57.0094729	,
		[149]=	57.20174823	,
		[150]=	57.39337941	,
		[151]=	57.58437288	,
		[152]=	57.77473496	,
		[153]=	57.96447188	,
		[154]=	58.15358974	,
		[155]=	58.34209458	,
		[156]=	58.52999231	,
		[157]=	58.71728877	,
		[158]=	58.90398968	,
		[159]=	59.09010069	,
		[160]=	59.27562737	,
		[161]=	59.46057517	,
		[162]=	59.64494949	,
		[163]=	59.82875563	,
		[164]=	60.0119988	,
		[165]=	60.19468415	,
		[166]=	60.37681674	,
		[167]=	60.55840156	,
		[168]=	60.73944353	,
		[169]=	60.91994747	,
		[170]=	61.09991817	,
		[171]=	61.27936031	,
		[172]=	61.45827853	,
		[173]=	61.63667739	,
		[174]=	61.81456139	,
		[175]=	61.99193496	,
		[176]=	62.16880247	,
		[177]=	62.34516822	,
		[178]=	62.52103646	,
		[179]=	62.69641138	,
		[180]=	62.87129711	,
		[181]=	63.04569771	,
		[182]=	63.21961721	,
		[183]=	63.39305956	,
		[184]=	63.56602866	,
		[185]=	63.73852838	,
		[186]=	63.91056251	,
		[187]=	64.0821348	,
		[188]=	64.25324895	,
		[189]=	64.42390861	,
		[190]=	64.59411738	,
		[191]=	64.76387882	,
		[192]=	64.93319644	,
		[193]=	65.1020737	,
		[194]=	65.27051402	,
		[195]=	65.43852077	,
		[196]=	65.60609728	,
		[197]=	65.77324684	,
		[198]=	65.9399727	,
		[199]=	66.10627807	,
		[200]=	66.2721661	,
		[201]=	66.43763993	,
		[202]=	66.60270265	,
		[203]=	66.76735729	,
		[204]=	66.93160688	,
		[205]=	67.09545439	,
		[206]=	67.25890276	,
		[207]=	67.42195488	,
		[208]=	67.58461363	,
		[209]=	67.74688185	,
		[210]=	67.90876232	,
		[211]=	68.07025782	,
		[212]=	68.23137108	,
		[213]=	68.39210481	,
		[214]=	68.55246166	,
		[215]=	68.71244429	,
		[216]=	68.87205529	,
		[217]=	69.03129725	,
		[218]=	69.19017271	,
		[219]=	69.3486842	,
		[220]=	69.5068342	,
		[221]=	69.66462517	,
		[222]=	69.82205955	,
		[223]=	69.97913975	,
		[224]=	70.13586814	,
		[225]=	70.29224708	,
		[226]=	70.4482789	,
		[227]=	70.60396589	,
		[228]=	70.75931034	,
		[229]=	70.91431449	,
		[230]=	71.06898058	,
		[231]=	71.22331079	,
		[232]=	71.37730732	,
		[233]=	71.53097231	,
		[234]=	71.68430791	,
		[235]=	71.83731621	,
		[236]=	71.98999931	,
		[237]=	72.14235926	,
		[238]=	72.29439812	,
		[239]=	72.44611791	,
		[240]=	72.59752062	,
		[241]=	72.74860823	,
		[242]=	72.89938271	,
		[243]=	73.049846	,
		[244]=	73.2	,
		[245]=	73.34984663	,
		[246]=	73.49938775	,
		[247]=	73.64862524	,
		[248]=	73.79756094	,
		[249]=	73.94619666	,
		[250]=	74.09453421	,
		[251]=	74.24257539	,
		[252]=	74.39032195	,
		[253]=	74.53777566	,
		[254]=	74.68493824	,
		[255]=	74.83181142	,
		[256]=	74.97839689	,
		[257]=	75.12469634	,
		[258]=	75.27071144	,
		[259]=	75.41644383	,
		[260]=	75.56189516	,
		[261]=	75.70706704	,
		[262]=	75.85196108	,
		[263]=	75.99657887	,
		[264]=	76.14092198	,
		[265]=	76.28499197	,
		[266]=	76.42879039	,
		[267]=	76.57231876	,
		[268]=	76.7155786	,
		[269]=	76.85857142	,
		[270]=	77.00129869	,
		[271]=	77.1437619	,
		[272]=	77.2859625	,
		[273]=	77.42790195	,
		[274]=	77.56958167	,
		[275]=	77.71100308	,
		[276]=	77.8521676	,
		[277]=	77.99307662	,
		[278]=	78.13373151	,
		[279]=	78.27413366	,
		[280]=	78.41428441	,
		[281]=	78.55418512	,
		[282]=	78.69383712	,
		[283]=	78.83324172	,
		[284]=	78.97240024	,
		[285]=	79.11131398	,
		[286]=	79.24998423	,
		[287]=	79.38841225	,
		[288]=	79.52659932	,
		[289]=	79.66454669	,
		[290]=	79.80225561	,
		[291]=	79.9397273	,
		[292]=	80.07696298	,
		[293]=	80.21396387	,
		[294]=	80.35073117	,
		[295]=	80.48726607	,
		[296]=	80.62356975	,
		[297]=	80.75964339	,
		[298]=	80.89548813	,
		[299]=	81.03110514	,
		[300]=	81.16649555	,
		[301]=	81.3016605	,
		[302]=	81.43660111	,
		[303]=	81.57131849	,
		[304]=	81.70581375	,
		[305]=	81.84008798	,
		[306]=	81.97414226	,
		[307]=	82.10797769	,
		[308]=	82.24159532	,
		[309]=	82.37499621	,
		[310]=	82.50818141	,
		[311]=	82.64115198	,
		[312]=	82.77390893	,
		[313]=	82.90645331	,
		[314]=	83.03878612	,
		[315]=	83.17090838	,
		[316]=	83.30282108	,
		[317]=	83.43452523	,
		[318]=	83.5660218	,
		[319]=	83.69731178	,
		[320]=	83.82839614	,
		[321]=	83.95927584	,
		[322]=	84.08995184	,
		[323]=	84.22042508	,
		[324]=	84.3506965	,
		[325]=	84.48076704	,
		[326]=	84.61063763	,
		[327]=	84.74030918	,
		[328]=	84.86978261	,
		[329]=	84.99905882	,
		[330]=	85.12813871	,
		[331]=	85.25702317	,
		[332]=	85.38571309	,
		[333]=	85.51420935	,
		[334]=	85.64251281	,
		[335]=	85.77062434	,
		[336]=	85.89854481	,
		[337]=	86.02627506	,
		[338]=	86.15381593	,
		[339]=	86.28116828	,
		[340]=	86.40833293	,
		[341]=	86.53531071	,
		[342]=	86.66210244	,
		[343]=	86.78870894	,
		[344]=	86.91513102	,
		[345]=	87.04136947	,
		[346]=	87.16742511	,
		[347]=	87.29329871	,
		[348]=	87.41899107	,
		[349]=	87.54450297	,
		[350]=	87.66983518	,
		[351]=	87.79498847	,
		[352]=	87.9199636	,
		[353]=	88.04476134	,
		[354]=	88.16938244	,
		[355]=	88.29382764	,
		[356]=	88.41809769	,
		[357]=	88.54219333	,
		[358]=	88.66611529	,
		[359]=	88.78986429	,
		[360]=	88.91344105	,
		[361]=	89.03684631	,
		[362]=	89.16008075	,
		[363]=	89.28314511	,
		[364]=	89.40604006	,
		[365]=	89.52876633	,
		[366]=	89.65132459	,
		[367]=	89.77371553	,
		[368]=	89.89593984	,
		[369]=	90.0179982	,
		[370]=	90.13989128	,
		[371]=	90.26161975	,
		[372]=	90.38318428	,
		[373]=	90.50458552	,
		[374]=	90.62582413	,
		[375]=	90.74690077	,
		[376]=	90.86781608	,
		[377]=	90.98857071	,
		[378]=	91.10916529	,
		[379]=	91.22960046	,
		[380]=	91.34987685	,
		[381]=	91.46999508	,
		[382]=	91.58995578	,
		[383]=	91.70975957	,
		[384]=	91.82940705	,
		[385]=	91.94889885	,
		[386]=	92.06823556	,
		[387]=	92.1874178	,
		[388]=	92.30644615	,
		[389]=	92.42532121	,
		[390]=	92.54404357	,
		[391]=	92.66261382	,
		[392]=	92.78103254	,
		[393]=	92.89930032	,
		[394]=	93.01741772	,
		[395]=	93.13538533	,
		[396]=	93.2532037	,
		[397]=	93.3708734	,
		[398]=	93.488395	,
		[399]=	93.60576905	,
		[400]=	93.72299611	,
		[401]=	93.84007673	,
		[402]=	93.95701145	,
		[403]=	94.07380082	,
		[404]=	94.19044538	,
		[405]=	94.30694566	,
		[406]=	94.42330221	,
		[407]=	94.53951555	,
		[408]=	94.65558621	,
		[409]=	94.77151471	,
		[410]=	94.88730157	,
		[411]=	95.00294732	,
		[412]=	95.11845247	,
		[413]=	95.23381752	,
		[414]=	95.34904299	,
		[415]=	95.46412939	,
		[416]=	95.57907721	,
		[417]=	95.69388695	,
		[418]=	95.80855912	,
		[419]=	95.9230942	,
		[420]=	96.03749268	,
		[421]=	96.15175505	,
		[422]=	96.26588181	,
		[423]=	96.37987342	,
		[424]=	96.49373037	,
		[425]=	96.60745313	,
		[426]=	96.72104218	,
		[427]=	96.83449798	,
		[428]=	96.94782102	,
		[429]=	97.06101174	,
		[430]=	97.17407062	,
		[431]=	97.2869981	,
		[432]=	97.39979466	,
		[433]=	97.51246074	,
		[434]=	97.6249968	,
		[435]=	97.73740328	,
		[436]=	97.84968063	,
		[437]=	97.9618293	,
		[438]=	98.07384973	,
		[439]=	98.18574235	,
		[440]=	98.2975076	,
		[441]=	98.40914592	,
		[442]=	98.52065773	,
		[443]=	98.63204347	,
		[444]=	98.74330357	,
		[445]=	98.85443844	,
		[446]=	98.96544852	,
		[447]=	99.07633421	,
		[448]=	99.18709593	,
		[449]=	99.29773411	,
		[450]=	99.40824915	,
		[451]=	99.51864147	,
		[452]=	99.62891147	,
		[453]=	99.73905955	,
		[454]=	99.84908613	,
		[455]=	99.95899159	,
		[456]=	100.0687763	,
		[457]=	100.1784408	,
		[458]=	100.2879853	,
		[459]=	100.3974103	,
		[460]=	100.5067162	,
		[461]=	100.6159033	,
		[462]=	100.7249721	,
		[463]=	100.8339229	,
		[464]=	100.9427561	,
		[465]=	101.051472	,
		[466]=	101.1600712	,
		[467]=	101.2685539	,
		[468]=	101.3769205	,
		[469]=	101.4851713	,
		[470]=	101.5933069	,
		[471]=	101.7013274	,
		[472]=	101.8092334	,
		[473]=	101.9170251	,
		[474]=	102.0247029	,
		[475]=	102.1322672	,
		[476]=	102.2397183	,
		[477]=	102.3470566	,
		[478]=	102.4542825	,
		[479]=	102.5613962	,
		[480]=	102.6683983	,
		[481]=	102.7752889	,
		[482]=	102.8820684	,
		[483]=	102.9887372	,
		[484]=	103.0952957	,
		[485]=	103.2017442	,
		[486]=	103.3080829	,
		[487]=	103.4143124	,
		[488]=	103.5204328	,
		[489]=	103.6264445	,
		[490]=	103.7323479	,
		[491]=	103.8381433	,
		[492]=	103.943831	,
		[493]=	104.0494113	,
		[494]=	104.1548847	,
		[495]=	104.2602513	,
		[496]=	104.3655115	,
		[497]=	104.4706657	,
		[498]=	104.5757142	,
		[499]=	104.6806572	,
		[500]=	104.7854952	,
		[501]=	104.8902283	,
		[502]=	104.994857	,
		[503]=	105.0993815	,
		[504]=	105.2038022	,
		[505]=	105.3081193	,
		[506]=	105.4123332	,
		[507]=	105.5164442	,
		[508]=	105.6204526	,
		[509]=	105.7243586	,
		[510]=	105.8281626	,
		[511]=	105.9318649	,
		[512]=	106.0354658	,
		[513]=	106.1389655	,
		[514]=	106.2423644	,
		[515]=	106.3456628	,
		[516]=	106.448861	,
		[517]=	106.5519592	,
		[518]=	106.6549577	,
		[519]=	106.7578569	,
		[520]=	106.8606569	,
		[521]=	106.9633582	,
		[522]=	107.065961	,
		[523]=	107.1684655	,
		[524]=	107.2708721	,
		[525]=	107.373181	,
		[526]=	107.4753925	,
		[527]=	107.5775069	,
		[528]=	107.6795245	,
		[529]=	107.7814455	,
		[530]=	107.8832703	,
		[531]=	107.984999	,
		[532]=	108.0866319	,
		[533]=	108.1881694	,
		[534]=	108.2896117	,
		[535]=	108.390959	,
		[536]=	108.4922117	,
		[537]=	108.59337	,
		[538]=	108.6944341	,
		[539]=	108.7954043	,
		[540]=	108.8962809	,
		[541]=	108.9970642	,
		[542]=	109.0977543	,
		[543]=	109.1983516	,
		[544]=	109.2988564	,
		[545]=	109.3992687	,
		[546]=	109.499589	,
		[547]=	109.5998175	,
		[548]=	109.6999544	,
		[549]=	109.8	,
		[550]=	109.8999545	,
		[551]=	109.9998182	,
		[552]=	110.0995913	,
		[553]=	110.199274	,
		[554]=	110.2988667	,
		[555]=	110.3983696	,
		[556]=	110.4977828	,
		[557]=	110.5971067	,
		[558]=	110.6963414	,
		[559]=	110.7954873	,
		[560]=	110.8945445	,
		[561]=	110.9935133	,
		[562]=	111.092394	,
		[563]=	111.1911867	,
		[564]=	111.2898917	,
		[565]=	111.3885093	,
		[566]=	111.4870396	,
		[567]=	111.5854829	,
		[568]=	111.6838395	,
		[569]=	111.7821095	,
		[570]=	111.8802932	,
		[571]=	111.9783908	,
		[572]=	112.0764025	,
		[573]=	112.1743286	,
		[574]=	112.2721693	,
		[575]=	112.3699248	,
		[576]=	112.4675953	,
		[577]=	112.5651811	,
		[578]=	112.6626824	,
		[579]=	112.7600993	,
		[580]=	112.8574322	,
		[581]=	112.9546812	,
		[582]=	113.0518465	,
		[583]=	113.1489284	,
		[584]=	113.2459271	,
		[585]=	113.3428427	,
		[586]=	113.4396756	,
		[587]=	113.5364259	,
		[588]=	113.6330938	,
		[589]=	113.7296795	,
		[590]=	113.8261833	,
		[591]=	113.9226053	,
		[592]=	114.0189458	,
		[593]=	114.1152049	,
		[594]=	114.211383	,
		[595]=	114.3074801	,
		[596]=	114.4034965	,
		[597]=	114.4994323	,
		[598]=	114.5952879	,
		[599]=	114.6910633	,
		[600]=	114.7867588	,
		[601]=	114.8823746	,
		[602]=	114.9779109	,
		[603]=	115.0733679	,
		[604]=	115.1687458	,
		[605]=	115.2640447	,
		[606]=	115.3592649	,
		[607]=	115.4544066	,
		[608]=	115.5494699	,
		[609]=	115.6444551	,
		[610]=	115.7393624	,
		[611]=	115.8341918	,
		[612]=	115.9289438	,
		[613]=	116.0236183	,
		[614]=	116.1182156	,
		[615]=	116.212736	,
		[616]=	116.3071795	,
		[617]=	116.4015464	,
		[618]=	116.4958368	,
		[619]=	116.590051	,
		[620]=	116.6841892	,
		[621]=	116.7782514	,
		[622]=	116.8722379	,
		[623]=	116.9661489	,
		[624]=	117.0599846	,
		[625]=	117.1537451	,
		[626]=	117.2474307	,
		[627]=	117.3410414	,
		[628]=	117.4345775	,
		[629]=	117.5280392	,
		[630]=	117.6214266	,
		[631]=	117.7147399	,
		[632]=	117.8079794	,
		[633]=	117.901145	,
		[634]=	117.9942371	,
		[635]=	118.0872559	,
		[636]=	118.1802014	,
		[637]=	118.2730739	,
		[638]=	118.3658735	,
		[639]=	118.4586004	,
		[640]=	118.5512547	,
		[641]=	118.6438368	,
		[642]=	118.7363466	,
		[643]=	118.8287844	,
		[644]=	118.9211503	,
		[645]=	119.0134446	,
		[646]=	119.1056674	,
		[647]=	119.1978188	,
		[648]=	119.289899	,
		[649]=	119.3819082	,
		[650]=	119.4738465	,
		[651]=	119.5657141	,
		[652]=	119.6575113	,
		[653]=	119.749238	,
		[654]=	119.8408945	,
		[655]=	119.932481	,
		[656]=	120.0239976	,
		[657]=	120.1154445	,
		[658]=	120.2068218	,
		[659]=	120.2981297	,
		[660]=	120.3893683	,
		[661]=	120.4805378	,
		[662]=	120.5716385	,
		[663]=	120.6626703	,
		[664]=	120.7536335	,
		[665]=	120.8445282	,
		[666]=	120.9353546	,
		[667]=	121.0261129	,
		[668]=	121.1168031	,
		[669]=	121.2074255	,
		[670]=	121.2979802	,
		[671]=	121.3884673	,
		[672]=	121.4788871	,
		[673]=	121.5692395	,
		[674]=	121.6595249	,
		[675]=	121.7497433	,
		[676]=	121.8398949	,
		[677]=	121.9299799	,
		[678]=	122.0199984	,
		[679]=	122.1099505	,
		[680]=	122.1998363	,
		[681]=	122.2896561	,
		[682]=	122.37941	,
		[683]=	122.4690981	,
		[684]=	122.5587206	,
		[685]=	122.6482776	,
		[686]=	122.7377692	,
		[687]=	122.8271957	,
		[688]=	122.9165571	,
		[689]=	123.0058535	,
		[690]=	123.0950852	,
		[691]=	123.1842522	,
		[692]=	123.2733548	,
		[693]=	123.362393	,
		[694]=	123.4513669	,
		[695]=	123.5402768	,
		[696]=	123.6291228	,
		[697]=	123.7179049	,
		[698]=	123.8066234	,
		[699]=	123.8952784	,
		[700]=	123.9838699	,
		[701]=	124.0723982	,
		[702]=	124.1608634	,
		[703]=	124.2492656	,
		[704]=	124.3376049	,
		[705]=	124.4258816	,
		[706]=	124.5140956	,
		[707]=	124.6022472	,
		[708]=	124.6903364	,
		[709]=	124.7783635	,
		[710]=	124.8663285	,
		[711]=	124.9542316	,
		[712]=	125.0420729	,
		[713]=	125.1298526	,
		[714]=	125.2175707	,
		[715]=	125.3052273	,
		[716]=	125.3928228	,
		[717]=	125.480357	,
		[718]=	125.5678303	,
		[719]=	125.6552426	,
		[720]=	125.7425942	,
		[721]=	125.8298852	,
		[722]=	125.9171156	,
		[723]=	126.0042856	,
		[724]=	126.0913954	,
		[725]=	126.1784451	,
		[726]=	126.2654347	,
		[727]=	126.3523644	,
		[728]=	126.4392344	,
		[729]=	126.5260447	,
		[730]=	126.6127956	,
		[731]=	126.699487	,
		[732]=	126.7861191	,
		[733]=	126.8726921	,
		[734]=	126.959206	,
		[735]=	127.0456611	,
		[736]=	127.1320573	,
		[737]=	127.2183949	,
		[738]=	127.3046739	,
		[739]=	127.3908945	,
		[740]=	127.4770568	,
		[741]=	127.5631608	,
		[742]=	127.6492068	,
		[743]=	127.7351948	,
		[744]=	127.821125	,
		[745]=	127.9069975	,
		[746]=	127.9928123	,
		[747]=	128.0785696	,
		[748]=	128.1642696	,
		[749]=	128.2499123	,
		[750]=	128.3354978	,
		[751]=	128.4210263	,
		[752]=	128.5064979	,
		[753]=	128.5919127	,
		[754]=	128.6772707	,
		[755]=	128.7625722	,
		[756]=	128.8478172	,
		[757]=	128.9330059	,
		[758]=	129.0181383	,
		[759]=	129.1032145	,
		[760]=	129.1882348	,
		[761]=	129.2731991	,
		[762]=	129.3581076	,
		[763]=	129.4429604	,
		[764]=	129.5277576	,
		[765]=	129.6124994	,
		[766]=	129.6971858	,
		[767]=	129.7818169	,
		[768]=	129.8663929	,
		[769]=	129.9509138	,
		[770]=	130.0353798	,
		[771]=	130.119791	,
		[772]=	130.2041474	,
		[773]=	130.2884492	,
		[774]=	130.3726965	,
		[775]=	130.4568894	,
		[776]=	130.541028	,
		[777]=	130.6251124	,
		[778]=	130.7091428	,
		[779]=	130.7931191	,
		[780]=	130.8770415	,
		[781]=	130.9609102	,
		[782]=	131.0447252	,
		[783]=	131.1284866	,
		[784]=	131.2121946	,
		[785]=	131.2958491	,
		[786]=	131.3794504	,
		[787]=	131.4629986	,
		[788]=	131.5464937	,
		[789]=	131.6299358	,
		[790]=	131.7133251	,
		[791]=	131.7966616	,
		[792]=	131.8799454	,
		[793]=	131.9631767	,
		[794]=	132.0463555	,
		[795]=	132.1294819	,
		[796]=	132.2125561	,
		[797]=	132.2955782	,
		[798]=	132.3785481	,
		[799]=	132.4614661	,
		[800]=	132.5443322	,
		[801]=	132.6271465	,
		[802]=	132.7099092	,
		[803]=	132.7926203	,
		[804]=	132.8752799	,
		[805]=	132.9578881	,
		[806]=	133.040445	,
		[807]=	133.1229507	,
		[808]=	133.2054053	,
		[809]=	133.2878089	,
		[810]=	133.3701616	,
		[811]=	133.4524634	,
		[812]=	133.5347146	,
		[813]=	133.6169151	,
		[814]=	133.6990651	,
		[815]=	133.7811646	,
		[816]=	133.8632138	,
		[817]=	133.9452127	,
		[818]=	134.0271614	,
		[819]=	134.1090601	,
		[820]=	134.1909088	,
		[821]=	134.2727076	,
		[822]=	134.3544566	,
		[823]=	134.4361559	,
		[824]=	134.5178055	,
		[825]=	134.5994056	,
		[826]=	134.6809563	,
		[827]=	134.7624577	,
		[828]=	134.8439098	,
		[829]=	134.9253127	,
		[830]=	135.0066665	,
		[831]=	135.0879713	,
		[832]=	135.1692273	,
		[833]=	135.2504344	,
		[834]=	135.3315928	,
		[835]=	135.4127025	,
		[836]=	135.4937637	,
		[837]=	135.5747764	,
		[838]=	135.6557408	,
		[839]=	135.7366568	,
		[840]=	135.8175246	,
		[841]=	135.8983444	,
		[842]=	135.979116	,
		[843]=	136.0598398	,
		[844]=	136.1405156	,
		[845]=	136.2211437	,
		[846]=	136.3017241	,
		[847]=	136.3822569	,
		[848]=	136.4627422	,
		[849]=	136.54318	,
		[850]=	136.6235704	,
		[851]=	136.7039136	,
		[852]=	136.7842096	,
		[853]=	136.8644585	,
		[854]=	136.9446604	,
		[855]=	137.0248153	,
		[856]=	137.1049233	,
		[857]=	137.1849846	,
		[858]=	137.2649992	,
		[859]=	137.3449671	,
		[860]=	137.4248886	,
		[861]=	137.5047636	,
		[862]=	137.5845922	,
		[863]=	137.6643745	,
		[864]=	137.7441106	,
		[865]=	137.8238006	,
		[866]=	137.9034445	,
		[867]=	137.9830424	,
		[868]=	138.0625945	,
		[869]=	138.1421008	,
		[870]=	138.2215613	,
		[871]=	138.3009761	,
		[872]=	138.3803454	,
		[873]=	138.4596692	,
		[874]=	138.5389476	,
		[875]=	138.6181806	,
		[876]=	138.6973684	,
		[877]=	138.776511	,
		[878]=	138.8556085	,
		[879]=	138.9346609	,
		[880]=	139.0136684	,
		[881]=	139.092631	,
		[882]=	139.1715488	,
		[883]=	139.2504219	,
		[884]=	139.3292503	,
		[885]=	139.4080342	,
		[886]=	139.4867736	,
		[887]=	139.5654685	,
		[888]=	139.6441191	,
		[889]=	139.7227254	,
		[890]=	139.8012875	,
		[891]=	139.8798055	,
		[892]=	139.9582795	,
		[893]=	140.0367095	,
		[894]=	140.1150955	,
		[895]=	140.1934378	,
		[896]=	140.2717363	,
		[897]=	140.3499911	,
		[898]=	140.4282023	,
		[899]=	140.50637	,
		[900]=	140.5844942	,
		[901]=	140.662575	,
		[902]=	140.7406125	,
		[903]=	140.8186067	,
		[904]=	140.8965578	,
		[905]=	140.9744658	,
		[906]=	141.0523307	,
		[907]=	141.1301527	,
		[908]=	141.2079318	,
		[909]=	141.2856681	,
		[910]=	141.3633616	,
		[911]=	141.4410124	,
		[912]=	141.5186207	,
		[913]=	141.5961864	,
		[914]=	141.6737096	,
		[915]=	141.7511905	,
		[916]=	141.828629	,
		[917]=	141.9060252	,
		[918]=	141.9833793	,
		[919]=	142.0606913	,
		[920]=	142.1379612	,
		[921]=	142.2151891	,
		[922]=	142.2923751	,
		[923]=	142.3695192	,
		[924]=	142.4466216	,
		[925]=	142.5236822	,
		[926]=	142.6007013	,
		[927]=	142.6776787	,
		[928]=	142.7546146	,
		[929]=	142.8315091	,
		[930]=	142.9083622	,
		[931]=	142.9851741	,
		[932]=	143.0619446	,
		[933]=	143.138674	,
		[934]=	143.2153623	,
		[935]=	143.2920095	,
		[936]=	143.3686158	,
		[937]=	143.4451812	,
		[938]=	143.5217057	,
		[939]=	143.5981894	,
		[940]=	143.6746324	,
		[941]=	143.7510348	,
		[942]=	143.8273966	,
		[943]=	143.9037178	,
		[944]=	143.9799986	,
		[945]=	144.056239	,
		[946]=	144.1324391	,
		[947]=	144.2085989	,
		[948]=	144.2847185	,
		[949]=	144.360798	,
		[950]=	144.4368374	,
		[951]=	144.5128368	,
		[952]=	144.5887962	,
		[953]=	144.6647158	,
		[954]=	144.7405955	,
		[955]=	144.8164355	,
		[956]=	144.8922358	,
		[957]=	144.9679965	,
		[958]=	145.0437175	,
		[959]=	145.1193991	,
		[960]=	145.1950412	,
		[961]=	145.270644	,
		[962]=	145.3462074	,
		[963]=	145.4217315	,
		[964]=	145.4972165	,
		[965]=	145.5726623	,
		[966]=	145.648069	,
		[967]=	145.7234367	,
		[968]=	145.7987654	,
		[969]=	145.8740553	,
		[970]=	145.9493063	,
		[971]=	146.0245185	,
		[972]=	146.099692	,
		[973]=	146.1748268	,
		[974]=	146.2499231	,
		[975]=	146.3249808	,
		[976]=	146.4	,
		[977]=	146.4749808	,
		[978]=	146.5499232	,
		[979]=	146.6248274	,
		[980]=	146.6996933	,
		[981]=	146.7745209	,
		[982]=	146.8493105	,
		[983]=	146.924062	,
		[984]=	146.9987755	,
		[985]=	147.073451	,
		[986]=	147.1480887	,
		[987]=	147.2226885	,
		[988]=	147.2972505	,
		[989]=	147.3717748	,
		[990]=	147.4462614	,
		[991]=	147.5207104	,
		[992]=	147.5951219	,
		[993]=	147.6694958	,
		[994]=	147.7438324	,
		[995]=	147.8181315	,
		[996]=	147.8923933	,
		[997]=	147.9666179	,
		[998]=	148.0408052	,
		[999]=	148.1149554	,
		[1000]=	148.1890684	,
	};

	local true_idx = (target_distance - accum_distance);

	if (true_idx <= 0)
	{
		return 15.0;
	}
	else if (true_idx > 1000)
	{
		return brake_pattern_table[1000];
	}
	else
	{
		true_idx = true_idx - (true_idx % 4);
		return brake_pattern_table[true_idx.tointeger()];
	}
}

function lookup_incoming_pattern(limit_speed, accum_distance, target_distance, offset_distance)
{
	local incoming_pattern_table = 
	{
		[0]=	5	,
		[1]=	5	,
		[2]=	5	,
		[3]=	5	,
		[4]=	5	,
		[5]=	5.039920318	,
		[6]=	5.998181668	,
		[7]=	6.879393924	,
		[8]=	7.699606293	,
		[9]=	8.469966592	,
		[10]=	9.198591479	,
		[11]=	9.891608375	,
		[12]=	10.55377768	,
		[13]=	11.18888508	,
		[14]=	11.8	,
		[15]=	12.3896521	,
		[16]=	12.95995546	,
		[17]=	13.51269834	,
		[18]=	14.04940944	,
		[19]=	14.57140772	,
		[20]=	15.07984064	,
		[21]=	15.57571384	,
		[22]=	16.05991453	,
		[23]=	16.53323013	,
		[24]=	16.99636334	,
		[25]=	17.44994432	,
		[26]=	17.89454083	,
		[27]=	18.33066651	,
		[28]=	18.75878785	,
		[29]=	19.17933002	,
		[30]=	19.59268184	,
		[31]=	19.99919999	,
		[32]=	20.39921259	,
		[33]=	20.79302231	,
		[34]=	21.18090908	,
		[35]=	21.56313235	,
		[36]=	21.93993318	,
		[37]=	22.31153602	,
		[38]=	22.67815023	,
		[39]=	23.03997147	,
		[40]=	23.39718296	,
		[41]=	23.74995652	,
		[42]=	24.09845357	,
		[43]=	24.44282595	,
		[44]=	24.78321675	,
		[45]=	25.11976096	,
		[46]=	25.4525861	,
		[47]=	25.78181281	,
		[48]=	26.10755535	,
		[49]=	26.42992205	,
		[50]=	26.74901573	,
		[51]=	27.06493412	,
		[52]=	27.37777015	,
		[53]=	27.68761233	,
		[54]=	27.994545	,
		[55]=	28.29864862	,
		[56]=	28.6	,
		[57]=	28.89867254	,
		[58]=	29.19473644	,
		[59]=	29.48825887	,
		[60]=	29.77930419	,
		[61]=	30.06793407	,
		[62]=	30.35420767	,
		[63]=	30.63818177	,
		[64]=	30.91991091	,
		[65]=	31.19944751	,
		[66]=	31.47684197	,
		[67]=	31.75214279	,
		[68]=	32.02539669	,
		[69]=	32.29664864	,
		[70]=	32.56594202	,
		[71]=	32.83331865	,
		[72]=	33.09881888	,
		[73]=	33.36248167	,
		[74]=	33.62434465	,
		[75]=	33.88444419	,
		[76]=	34.14281543	,
		[77]=	34.39949238	,
		[78]=	34.65450794	,
		[79]=	34.90789396	,
		[80]=	35.15968127	,
		[81]=	35.40989978	,
		[82]=	35.65857843	,
		[83]=	35.90574532	,
		[84]=	36.15142768	,
		[85]=	36.39565195	,
		[86]=	36.63844377	,
		[87]=	36.87982808	,
		[88]=	37.11982906	,
		[89]=	37.35847023	,
		[90]=	37.59577444	,
		[91]=	37.83176391	,
		[92]=	38.06646027	,
		[93]=	38.29988453	,
		[94]=	38.53205715	,
		[95]=	38.76299807	,
		[96]=	38.99272667	,
		[97]=	39.22126185	,
		[98]=	39.44862203	,
		[99]=	39.67482513	,
		[100]=	39.89988864	,
		[101]=	40.12382962	,
		[102]=	40.34666471	,
		[103]=	40.56841011	,
		[104]=	40.78908167	,
		[105]=	41.00869483	,
		[106]=	41.22726468	,
		[107]=	41.44480595	,
		[108]=	41.66133303	,
		[109]=	41.87685996	,
		[110]=	42.09140049	,
		[111]=	42.30496803	,
		[112]=	42.5175757	,
		[113]=	42.72923632	,
		[114]=	42.93996245	,
		[115]=	43.14976635	,
		[116]=	43.35866003	,
		[117]=	43.56665523	,
		[118]=	43.77376344	,
		[119]=	43.97999592	,
		[120]=	44.18536368	,
		[121]=	44.38987751	,
		[122]=	44.59354797	,
		[123]=	44.79638541	,
		[124]=	44.99839997	,
		[125]=	45.19960159	,
		[126]=	45.4	,
		[127]=	45.59960474	,
		[128]=	45.79842517	,
		[129]=	45.99647047	,
		[130]=	46.19374962	,
		[131]=	46.39027145	,
		[132]=	46.58604462	,
		[133]=	46.78107762	,
		[134]=	46.97537879	,
		[135]=	47.16895629	,
		[136]=	47.36181815	,
		[137]=	47.55397226	,
		[138]=	47.74542634	,
		[139]=	47.936188	,
		[140]=	48.12626469	,
		[141]=	48.31566374	,
		[142]=	48.50439234	,
		[143]=	48.69245757	,
		[144]=	48.87986637	,
		[145]=	49.06662557	,
		[146]=	49.25274187	,
		[147]=	49.43822187	,
		[148]=	49.62307205	,
		[149]=	49.80729878	,
		[150]=	49.99090834	,
		[151]=	50.17390688	,
		[152]=	50.35630045	,
		[153]=	50.53809503	,
		[154]=	50.71929648	,
		[155]=	50.89991055	,
		[156]=	51.07994294	,
		[157]=	51.25939921	,
		[158]=	51.43828488	,
		[159]=	51.61660534	,
		[160]=	51.79436592	,
		[161]=	51.97157186	,
		[162]=	52.14822832	,
		[163]=	52.32434038	,
		[164]=	52.49991304	,
		[165]=	52.67495124	,
		[166]=	52.84945981	,
		[167]=	53.02344354	,
		[168]=	53.19690713	,
		[169]=	53.36985523	,
		[170]=	53.5422924	,
		[171]=	53.71422315	,
		[172]=	53.8856519	,
		[173]=	54.05658304	,
		[174]=	54.22702086	,
		[175]=	54.39696962	,
		[176]=	54.5664335	,
		[177]=	54.73541663	,
		[178]=	54.90392308	,
		[179]=	55.07195685	,
		[180]=	55.23952191	,
		[181]=	55.40662215	,
		[182]=	55.57326143	,
		[183]=	55.73944353	,
		[184]=	55.90517219	,
		[185]=	56.07045112	,
		[186]=	56.23528395	,
		[187]=	56.39967427	,
		[188]=	56.56362562	,
		[189]=	56.72714152	,
		[190]=	56.8902254	,
		[191]=	57.05288067	,
		[192]=	57.2151107	,
		[193]=	57.37691881	,
		[194]=	57.53830826	,
		[195]=	57.69928229	,
		[196]=	57.8598441	,
		[197]=	58.01999683	,
		[198]=	58.17974359	,
		[199]=	58.33908746	,
		[200]=	58.49803147	,
		[201]=	58.65657861	,
		[202]=	58.81473184	,
		[203]=	58.97249409	,
		[204]=	59.12986824	,
		[205]=	59.28685713	,
		[206]=	59.44346359	,
		[207]=	59.5996904	,
		[208]=	59.7555403	,
		[209]=	59.91101601	,
		[210]=	60.06612022	,
		[211]=	60.22085556	,
		[212]=	60.37522467	,
		[213]=	60.52923012	,
		[214]=	60.68287448	,
		[215]=	60.83616028	,
		[216]=	60.98909001	,
		[217]=	61.14166614	,
		[218]=	61.29389112	,
		[219]=	61.44576736	,
		[220]=	61.59729724	,
		[221]=	61.74848313	,
		[222]=	61.89932735	,
		[223]=	62.04983221	,
		[224]=	62.2	,
		[225]=	62.34983296	,
		[226]=	62.49933333	,
		[227]=	62.64850331	,
		[228]=	62.79734508	,
		[229]=	62.9458608	,
		[230]=	63.0940526	,
		[231]=	63.2419226	,
		[232]=	63.38947287	,
		[233]=	63.53670549	,
		[234]=	63.6836225	,
		[235]=	63.83022592	,
		[236]=	63.97651774	,
		[237]=	64.12249995	,
		[238]=	64.26817451	,
		[239]=	64.41354335	,
		[240]=	64.55860838	,
		[241]=	64.70337151	,
		[242]=	64.84783461	,
		[243]=	64.99199954	,
		[244]=	65.13586814	,
		[245]=	65.27944223	,
		[246]=	65.42272361	,
		[247]=	65.56571405	,
		[248]=	65.70841534	,
		[249]=	65.85082921	,
		[250]=	65.9929574	,
		[251]=	66.13480161	,
		[252]=	66.27636354	,
		[253]=	66.41764488	,
		[254]=	66.55864728	,
		[255]=	66.69937238	,
		[256]=	66.83982183	,
		[257]=	66.97999722	,
		[258]=	67.11990017	,
		[259]=	67.25953224	,
		[260]=	67.39889502	,
		[261]=	67.53799005	,
		[262]=	67.67681886	,
		[263]=	67.81538299	,
		[264]=	67.95368394	,
		[265]=	68.0917232	,
		[266]=	68.22950225	,
		[267]=	68.36702256	,
		[268]=	68.50428559	,
		[269]=	68.64129276	,
		[270]=	68.77804551	,
		[271]=	68.91454525	,
		[272]=	69.05079338	,
		[273]=	69.18679128	,
		[274]=	69.32254032	,
		[275]=	69.45804188	,
		[276]=	69.59329729	,
		[277]=	69.72830789	,
		[278]=	69.86307501	,
		[279]=	69.99759996	,
		[280]=	70.13188404	,
		[281]=	70.26592855	,
		[282]=	70.39973475	,
		[283]=	70.53330391	,
		[284]=	70.6666373	,
		[285]=	70.79973615	,
		[286]=	70.93260169	,
		[287]=	71.06523516	,
		[288]=	71.19763776	,
		[289]=	71.32981069	,
		[290]=	71.46175515	,
		[291]=	71.59347231	,
		[292]=	71.72496334	,
		[293]=	71.85622942	,
		[294]=	71.98727168	,
		[295]=	72.11809126	,
		[296]=	72.24868931	,
		[297]=	72.37906694	,
		[298]=	72.50922526	,
		[299]=	72.63916537	,
		[300]=	72.76888838	,
		[301]=	72.89839536	,
		[302]=	73.02768739	,
		[303]=	73.15676554	,
		[304]=	73.28563087	,
		[305]=	73.41428441	,
		[306]=	73.54272723	,
		[307]=	73.67096033	,
		[308]=	73.79898477	,
		[309]=	73.92680153	,
		[310]=	74.05441164	,
		[311]=	74.18181609	,
		[312]=	74.30901588	,
		[313]=	74.43601198	,
		[314]=	74.56280538	,
		[315]=	74.68939704	,
		[316]=	74.81578791	,
		[317]=	74.94197896	,
		[318]=	75.06797112	,
		[319]=	75.19376534	,
		[320]=	75.31936255	,
		[321]=	75.44476366	,
		[322]=	75.56996959	,
		[323]=	75.69498126	,
		[324]=	75.81979955	,
		[325]=	75.94442538	,
		[326]=	76.06885962	,
		[327]=	76.19310316	,
		[328]=	76.31715686	,
		[329]=	76.4410216	,
		[330]=	76.56469825	,
		[331]=	76.68818764	,
		[332]=	76.81149064	,
		[333]=	76.93460807	,
		[334]=	77.05754079	,
		[335]=	77.18028961	,
		[336]=	77.30285536	,
		[337]=	77.42523885	,
		[338]=	77.54744091	,
		[339]=	77.66946232	,
		[340]=	77.79130389	,
		[341]=	77.91296642	,
		[342]=	78.03445068	,
		[343]=	78.15575747	,
		[344]=	78.27688755	,
		[345]=	78.3978417	,
		[346]=	78.51862068	,
		[347]=	78.63922525	,
		[348]=	78.75965616	,
		[349]=	78.87991416	,
		[350]=	79	,
		[351]=	79.11991441	,
		[352]=	79.23965812	,
		[353]=	79.35923186	,
		[354]=	79.47863635	,
		[355]=	79.59787231	,
		[356]=	79.71694045	,
		[357]=	79.83584148	,
		[358]=	79.9545761	,
		[359]=	80.073145	,
		[360]=	80.19154888	,
		[361]=	80.30978842	,
		[362]=	80.42786431	,
		[363]=	80.54577722	,
		[364]=	80.66352783	,
		[365]=	80.7811168	,
		[366]=	80.89854481	,
		[367]=	81.0158125	,
		[368]=	81.13292054	,
		[369]=	81.24986957	,
		[370]=	81.36666023	,
		[371]=	81.48329318	,
		[372]=	81.59976905	,
		[373]=	81.71608847	,
		[374]=	81.83225207	,
		[375]=	81.94826048	,
		[376]=	82.06411431	,
		[377]=	82.17981418	,
		[378]=	82.2953607	,
		[379]=	82.41075449	,
		[380]=	82.52599614	,
		[381]=	82.64108626	,
		[382]=	82.75602543	,
		[383]=	82.87081427	,
		[384]=	82.98545334	,
		[385]=	83.09994325	,
		[386]=	83.21428456	,
		[387]=	83.32847785	,
		[388]=	83.44252371	,
		[389]=	83.55642269	,
		[390]=	83.67017537	,
		[391]=	83.7837823	,
		[392]=	83.89724405	,
		[393]=	84.01056117	,
		[394]=	84.12373421	,
		[395]=	84.23676372	,
		[396]=	84.34965025	,
		[397]=	84.46239433	,
		[398]=	84.57499651	,
		[399]=	84.68745732	,
		[400]=	84.79977728	,
		[401]=	84.91195694	,
		[402]=	85.0239968	,
		[403]=	85.1358974	,
		[404]=	85.24765925	,
		[405]=	85.35928287	,
		[406]=	85.47076876	,
		[407]=	85.58211744	,
		[408]=	85.69332941	,
		[409]=	85.80440518	,
		[410]=	85.91534524	,
		[411]=	86.02615009	,
		[412]=	86.13682022	,
		[413]=	86.24735613	,
		[414]=	86.35775829	,
		[415]=	86.4680272	,
		[416]=	86.57816334	,
		[417]=	86.68816718	,
		[418]=	86.79803919	,
		[419]=	86.90777987	,
		[420]=	87.01738966	,
		[421]=	87.12686904	,
		[422]=	87.23621848	,
		[423]=	87.34543844	,
		[424]=	87.45452936	,
		[425]=	87.56349172	,
		[426]=	87.67232597	,
		[427]=	87.78103254	,
		[428]=	87.88961191	,
		[429]=	87.9980645	,
		[430]=	88.10639076	,
		[431]=	88.21459113	,
		[432]=	88.32266606	,
		[433]=	88.43061597	,
		[434]=	88.5384413	,
		[435]=	88.64614247	,
		[436]=	88.75371993	,
		[437]=	88.86117408	,
		[438]=	88.96850536	,
		[439]=	89.07571419	,
		[440]=	89.18280098	,
		[441]=	89.28976615	,
		[442]=	89.39661011	,
		[443]=	89.50333327	,
		[444]=	89.60993605	,
		[445]=	89.71641885	,
		[446]=	89.82278207	,
		[447]=	89.92902612	,
		[448]=	90.03515139	,
		[449]=	90.14115829	,
		[450]=	90.2470472	,
		[451]=	90.35281852	,
		[452]=	90.45847265	,
		[453]=	90.56400996	,
		[454]=	90.66943085	,
		[455]=	90.77473571	,
		[456]=	90.87992491	,
		[457]=	90.98499883	,
		[458]=	91.08995785	,
		[459]=	91.19480235	,
		[460]=	91.29953271	,
		[461]=	91.40414929	,
		[462]=	91.50865246	,
		[463]=	91.6130426	,
		[464]=	91.71732006	,
		[465]=	91.82148522	,
		[466]=	91.92553843	,
		[467]=	92.02948006	,
		[468]=	92.13331046	,
		[469]=	92.23702998	,
		[470]=	92.340639	,
		[471]=	92.44413784	,
		[472]=	92.54752688	,
		[473]=	92.65080645	,
		[474]=	92.7539769	,
		[475]=	92.85703858	,
		[476]=	92.95999183	,
		[477]=	93.062837	,
		[478]=	93.16557441	,
		[479]=	93.26820442	,
		[480]=	93.37072735	,
		[481]=	93.47314355	,
		[482]=	93.57545333	,
		[483]=	93.67765705	,
		[484]=	93.77975501	,
		[485]=	93.88174756	,
		[486]=	93.98363501	,
		[487]=	94.0854177	,
		[488]=	94.18709593	,
		[489]=	94.28867005	,
		[490]=	94.39014036	,
		[491]=	94.49150718	,
		[492]=	94.59277082	,
		[493]=	94.69393161	,
		[494]=	94.79498985	,
		[495]=	94.89594586	,
		[496]=	94.99679995	,
		[497]=	95.09755242	,
		[498]=	95.19820358	,
		[499]=	95.29875373	,
		[500]=	95.39920318	,
		[501]=	95.49955224	,
		[502]=	95.59980119	,
		[503]=	95.69995035	,
		[504]=	95.8	,
		[505]=	95.89995045	,
		[506]=	95.99980198	,
		[507]=	96.0995549	,
		[508]=	96.19920948	,
		[509]=	96.29876603	,
		[510]=	96.39822484	,
		[511]=	96.49758618	,
		[512]=	96.59685034	,
		[513]=	96.69601762	,
		[514]=	96.79508829	,
		[515]=	96.89406263	,
		[516]=	96.99294093	,
		[517]=	97.09172346	,
		[518]=	97.19041051	,
		[519]=	97.28900234	,
		[520]=	97.38749924	,
		[521]=	97.48590147	,
		[522]=	97.58420931	,
		[523]=	97.68242303	,
		[524]=	97.78054291	,
		[525]=	97.8785692	,
		[526]=	97.97650217	,
		[527]=	98.0743421	,
		[528]=	98.17208925	,
		[529]=	98.26974387	,
		[530]=	98.36730624	,
		[531]=	98.46477662	,
		[532]=	98.56215525	,
		[533]=	98.65944241	,
		[534]=	98.75663834	,
		[535]=	98.85374331	,
		[536]=	98.95075757	,
		[537]=	99.04768138	,
		[538]=	99.14451498	,
		[539]=	99.24125863	,
		[540]=	99.33791257	,
		[541]=	99.43447707	,
		[542]=	99.53095235	,
		[543]=	99.62733868	,
		[544]=	99.7236363	,
		[545]=	99.81984545	,
		[546]=	99.91596637	,
		[547]=	100.0119993	,
		[548]=	100.1079445	,
		[549]=	100.2038022	,
		[550]=	100.2995726	,
		[551]=	100.3952561	,
		[552]=	100.4908527	,
		[553]=	100.5863628	,
		[554]=	100.6817865	,
		[555]=	100.7771242	,
		[556]=	100.872376	,
		[557]=	100.9675422	,
		[558]=	101.062623	,
		[559]=	101.1576187	,
		[560]=	101.2525294	,
		[561]=	101.3473554	,
		[562]=	101.4420969	,
		[563]=	101.5367542	,
		[564]=	101.6313275	,
		[565]=	101.7258169	,
		[566]=	101.8202228	,
		[567]=	101.9145453	,
		[568]=	102.0087847	,
		[569]=	102.1029411	,
		[570]=	102.1970149	,
		[571]=	102.2910061	,
		[572]=	102.3849151	,
		[573]=	102.4787421	,
		[574]=	102.5724872	,
		[575]=	102.6661507	,
		[576]=	102.7597327	,
		[577]=	102.8532336	,
		[578]=	102.9466535	,
		[579]=	103.0399926	,
		[580]=	103.1332511	,
		[581]=	103.2264293	,
		[582]=	103.3195273	,
		[583]=	103.4125454	,
		[584]=	103.5054837	,
		[585]=	103.5983425	,
		[586]=	103.691122	,
		[587]=	103.7838223	,
		[588]=	103.8764437	,
		[589]=	103.9689864	,
		[590]=	104.0614506	,
		[591]=	104.1538364	,
		[592]=	104.2461441	,
		[593]=	104.3383739	,
		[594]=	104.4305259	,
		[595]=	104.5226004	,
		[596]=	104.6145976	,
		[597]=	104.7065176	,
		[598]=	104.7983606	,
		[599]=	104.8901269	,
		[600]=	104.9818167	,
		[601]=	105.07343	,
		[602]=	105.1649672	,
		[603]=	105.2564284	,
		[604]=	105.3478138	,
		[605]=	105.4391235	,
		[606]=	105.5303578	,
		[607]=	105.6215169	,
		[608]=	105.7126009	,
		[609]=	105.80361	,
		[610]=	105.8945445	,
		[611]=	105.9854044	,
		[612]=	106.0761901	,
		[613]=	106.1669015	,
		[614]=	106.2575391	,
		[615]=	106.3481028	,
		[616]=	106.438593	,
		[617]=	106.5290097	,
		[618]=	106.6193532	,
		[619]=	106.7096236	,
		[620]=	106.7998211	,
		[621]=	106.8899459	,
		[622]=	106.9799982	,
		[623]=	107.0699781	,
		[624]=	107.1598859	,
		[625]=	107.2497216	,
		[626]=	107.3394855	,
		[627]=	107.4291777	,
		[628]=	107.5187984	,
		[629]=	107.6083478	,
		[630]=	107.6978261	,
		[631]=	107.7872333	,
		[632]=	107.8765698	,
		[633]=	107.9658355	,
		[634]=	108.0550308	,
		[635]=	108.1441558	,
		[636]=	108.2332107	,
		[637]=	108.3221955	,
		[638]=	108.4111106	,
		[639]=	108.4999559	,
		[640]=	108.5887318	,
		[641]=	108.6774384	,
		[642]=	108.7660758	,
		[643]=	108.8546442	,
		[644]=	108.9431437	,
		[645]=	109.0315746	,
		[646]=	109.1199369	,
		[647]=	109.2082309	,
		[648]=	109.2964566	,
		[649]=	109.3846144	,
		[650]=	109.4727042	,
		[651]=	109.5607263	,
		[652]=	109.6486808	,
		[653]=	109.7365678	,
		[654]=	109.8243877	,
		[655]=	109.9121404	,
		[656]=	109.9998261	,
		[657]=	110.087445	,
		[658]=	110.1749973	,
		[659]=	110.2624831	,
		[660]=	110.3499025	,
		[661]=	110.4372557	,
		[662]=	110.5245428	,
		[663]=	110.6117641	,
		[664]=	110.6989196	,
		[665]=	110.7860095	,
		[666]=	110.873034	,
		[667]=	110.9599931	,
		[668]=	111.0468871	,
		[669]=	111.133716	,
		[670]=	111.2204801	,
		[671]=	111.3071795	,
		[672]=	111.3938143	,
		[673]=	111.4803846	,
		[674]=	111.5668907	,
		[675]=	111.6533326	,
		[676]=	111.7397105	,
		[677]=	111.8260245	,
		[678]=	111.9122748	,
		[679]=	111.9984615	,
		[680]=	112.0845848	,
		[681]=	112.1706448	,
		[682]=	112.2566416	,
		[683]=	112.3425754	,
		[684]=	112.4284463	,
		[685]=	112.5142545	,
		[686]=	112.6	,
		[687]=	112.6856831	,
		[688]=	112.7713038	,
		[689]=	112.8568623	,
		[690]=	112.9423588	,
		[691]=	113.0277933	,
		[692]=	113.1131661	,
		[693]=	113.1984771	,
		[694]=	113.2837267	,
		[695]=	113.3689148	,
		[696]=	113.4540417	,
		[697]=	113.5391075	,
		[698]=	113.6241122	,
		[699]=	113.7090561	,
		[700]=	113.7939392	,
		[701]=	113.8787618	,
		[702]=	113.9635238	,
		[703]=	114.0482255	,
		[704]=	114.132867	,
		[705]=	114.2174484	,
		[706]=	114.3019698	,
		[707]=	114.3864314	,
		[708]=	114.4708333	,
		[709]=	114.5551755	,
		[710]=	114.6394584	,
		[711]=	114.7236819	,
		[712]=	114.8078462	,
		[713]=	114.8919514	,
		[714]=	114.9759976	,
		[715]=	115.059985	,
		[716]=	115.1439137	,
		[717]=	115.2277838	,
		[718]=	115.3115955	,
		[719]=	115.3953487	,
		[720]=	115.4790438	,
		[721]=	115.5626808	,
		[722]=	115.6462598	,
		[723]=	115.7297809	,
		[724]=	115.8132443	,
		[725]=	115.8966501	,
		[726]=	115.9799983	,
		[727]=	116.0632892	,
		[728]=	116.1465229	,
		[729]=	116.2296993	,
		[730]=	116.3128188	,
		[731]=	116.3958813	,
		[732]=	116.4788871	,
		[733]=	116.5618361	,
		[734]=	116.6447286	,
		[735]=	116.7275647	,
		[736]=	116.8103444	,
		[737]=	116.8930679	,
		[738]=	116.9757353	,
		[739]=	117.0583467	,
		[740]=	117.1409022	,
		[741]=	117.223402	,
		[742]=	117.3058461	,
		[743]=	117.3882347	,
		[744]=	117.4705679	,
		[745]=	117.5528457	,
		[746]=	117.6350684	,
		[747]=	117.717236	,
		[748]=	117.7993485	,
		[749]=	117.8814062	,
		[750]=	117.9634092	,
		[751]=	118.0453575	,
		[752]=	118.1272512	,
		[753]=	118.2090906	,
		[754]=	118.2908756	,
		[755]=	118.3726064	,
		[756]=	118.454283	,
		[757]=	118.5359057	,
		[758]=	118.6174745	,
		[759]=	118.6989895	,
		[760]=	118.7804508	,
		[761]=	118.8618585	,
		[762]=	118.9432128	,
		[763]=	119.0245137	,
		[764]=	119.1057613	,
		[765]=	119.1869558	,
		[766]=	119.2680973	,
		[767]=	119.3491858	,
		[768]=	119.4302214	,
		[769]=	119.5112043	,
		[770]=	119.5921346	,
		[771]=	119.6730123	,
		[772]=	119.7538376	,
		[773]=	119.8346106	,
		[774]=	119.9153313	,
		[775]=	119.9959999	,
		[776]=	120.0766165	,
		[777]=	120.1571812	,
		[778]=	120.237694	,
		[779]=	120.3181551	,
		[780]=	120.3985646	,
		[781]=	120.4789225	,
		[782]=	120.5592291	,
		[783]=	120.6394842	,
		[784]=	120.7196882	,
		[785]=	120.799841	,
		[786]=	120.8799428	,
		[787]=	120.9599936	,
		[788]=	121.0399937	,
		[789]=	121.1199429	,
		[790]=	121.1998415	,
		[791]=	121.2796896	,
		[792]=	121.3594872	,
		[793]=	121.4392344	,
		[794]=	121.5189314	,
		[795]=	121.5985782	,
		[796]=	121.6781749	,
		[797]=	121.7577217	,
		[798]=	121.8372185	,
		[799]=	121.9166656	,
		[800]=	121.9960629	,
		[801]=	122.0754107	,
		[802]=	122.1547089	,
		[803]=	122.2339577	,
		[804]=	122.3131572	,
		[805]=	122.3923075	,
		[806]=	122.4714086	,
		[807]=	122.5504606	,
		[808]=	122.6294637	,
		[809]=	122.7084179	,
		[810]=	122.7873233	,
		[811]=	122.86618	,
		[812]=	122.9449882	,
		[813]=	123.0237478	,
		[814]=	123.102459	,
		[815]=	123.1811219	,
		[816]=	123.2597365	,
		[817]=	123.3383029	,
		[818]=	123.4168213	,
		[819]=	123.4952917	,
		[820]=	123.5737143	,
		[821]=	123.652089	,
		[822]=	123.730416	,
		[823]=	123.8086954	,
		[824]=	123.8869272	,
		[825]=	123.9651116	,
		[826]=	124.0432486	,
		[827]=	124.1213383	,
		[828]=	124.1993808	,
		[829]=	124.2773762	,
		[830]=	124.3553246	,
		[831]=	124.433226	,
		[832]=	124.5110806	,
		[833]=	124.5888884	,
		[834]=	124.6666495	,
		[835]=	124.744364	,
		[836]=	124.822032	,
		[837]=	124.8996536	,
		[838]=	124.9772288	,
		[839]=	125.0547577	,
		[840]=	125.1322404	,
		[841]=	125.2096771	,
		[842]=	125.2870677	,
		[843]=	125.3644123	,
		[844]=	125.4417111	,
		[845]=	125.5189641	,
		[846]=	125.5961715	,
		[847]=	125.6733332	,
		[848]=	125.7504493	,
		[849]=	125.82752	,
		[850]=	125.9045454	,
		[851]=	125.9815254	,
		[852]=	126.0584602	,
		[853]=	126.1353499	,
		[854]=	126.2121946	,
		[855]=	126.2889942	,
		[856]=	126.365749	,
		[857]=	126.4424589	,
		[858]=	126.5191241	,
		[859]=	126.5957446	,
		[860]=	126.6723206	,
		[861]=	126.748852	,
		[862]=	126.825339	,
		[863]=	126.9017816	,
		[864]=	126.97818	,
		[865]=	127.0545342	,
		[866]=	127.1308442	,
		[867]=	127.2071102	,
		[868]=	127.2833323	,
		[869]=	127.3595104	,
		[870]=	127.4356447	,
		[871]=	127.5117353	,
		[872]=	127.5877822	,
		[873]=	127.6637856	,
		[874]=	127.7397454	,
		[875]=	127.8156617	,
		[876]=	127.8915347	,
		[877]=	127.9673644	,
		[878]=	128.0431509	,
		[879]=	128.1188942	,
		[880]=	128.1945945	,
		[881]=	128.2702517	,
		[882]=	128.3458661	,
		[883]=	128.4214376	,
		[884]=	128.4969663	,
		[885]=	128.5724522	,
		[886]=	128.6478956	,
		[887]=	128.7232964	,
		[888]=	128.7986547	,
		[889]=	128.8739706	,
		[890]=	128.9492441	,
		[891]=	129.0244754	,
		[892]=	129.0996644	,
		[893]=	129.1748113	,
		[894]=	129.2499162	,
		[895]=	129.3249791	,
		[896]=	129.4	,
		[897]=	129.4749791	,
		[898]=	129.5499164	,
		[899]=	129.624812	,
		[900]=	129.6996659	,
		[901]=	129.7744783	,
		[902]=	129.8492492	,
		[903]=	129.9239786	,
		[904]=	129.9986667	,
		[905]=	130.0733134	,
		[906]=	130.147919	,
		[907]=	130.2224833	,
		[908]=	130.2970066	,
		[909]=	130.3714889	,
		[910]=	130.4459302	,
		[911]=	130.5203306	,
		[912]=	130.5946902	,
		[913]=	130.669009	,
		[914]=	130.7432871	,
		[915]=	130.8175246	,
		[916]=	130.8917216	,
		[917]=	130.9658781	,
		[918]=	131.0399941	,
		[919]=	131.1140698	,
		[920]=	131.1881052	,
		[921]=	131.2621004	,
		[922]=	131.3360554	,
		[923]=	131.4099703	,
		[924]=	131.4838452	,
		[925]=	131.5576801	,
		[926]=	131.6314751	,
		[927]=	131.7052303	,
		[928]=	131.7789457	,
		[929]=	131.8526215	,
		[930]=	131.9262575	,
		[931]=	131.999854	,
		[932]=	132.073411	,
		[933]=	132.1469285	,
		[934]=	132.2204066	,
		[935]=	132.2938455	,
		[936]=	132.367245	,
		[937]=	132.4406054	,
		[938]=	132.5139266	,
		[939]=	132.5872087	,
		[940]=	132.6604518	,
		[941]=	132.733656	,
		[942]=	132.8068213	,
		[943]=	132.8799478	,
		[944]=	132.9530355	,
		[945]=	133.0260845	,
		[946]=	133.0990949	,
		[947]=	133.1720666	,
		[948]=	133.2449999	,
		[949]=	133.3178947	,
		[950]=	133.3907511	,
		[951]=	133.4635692	,
		[952]=	133.536349	,
		[953]=	133.6090906	,
		[954]=	133.681794	,
		[955]=	133.7544594	,
		[956]=	133.8270867	,
		[957]=	133.899676	,
		[958]=	133.9722274	,
		[959]=	134.044741	,
		[960]=	134.1172168	,
		[961]=	134.1896548	,
		[962]=	134.2620551	,
		[963]=	134.3344179	,
		[964]=	134.406743	,
		[965]=	134.4790307	,
		[966]=	134.5512809	,
		[967]=	134.6234937	,
		[968]=	134.6956692	,
		[969]=	134.7678075	,
		[970]=	134.8399085	,
		[971]=	134.9119723	,
		[972]=	134.9839991	,
		[973]=	135.0559888	,
		[974]=	135.1279415	,
		[975]=	135.1998573	,
		[976]=	135.2717363	,
		[977]=	135.3435784	,
		[978]=	135.4153838	,
		[979]=	135.4871524	,
		[980]=	135.5588845	,
		[981]=	135.6305799	,
		[982]=	135.7022388	,
		[983]=	135.7738612	,
		[984]=	135.8454472	,
		[985]=	135.9169968	,
		[986]=	135.9885102	,
		[987]=	136.0599872	,
		[988]=	136.1314281	,
		[989]=	136.2028328	,
		[990]=	136.2742015	,
		[991]=	136.3455341	,
		[992]=	136.4168307	,
		[993]=	136.4880914	,
		[994]=	136.5593162	,
		[995]=	136.6305052	,
		[996]=	136.7016584	,
		[997]=	136.7727759	,
		[998]=	136.8438578	,
		[999]=	136.9149041	,
		[1000]=	136.9859148	,
	}
	local true_idx = (target_distance - accum_distance);

	if (true_idx <= 0)
	{
		return 10.0;
	}
	else if (true_idx > 1000)
	{
		return incoming_pattern_table[1000];
	}
	else
	{
		true_idx = true_idx - (true_idx % 4);
		return incoming_pattern_table[true_idx.tointeger()];
	}
}

function self_erase(accum_distance, target_distance)
{
	if ((target_distance - accum_distance) <= -50.0)
	{
		return true;
	}
	else
	{
		return false;
	}
}

function pattern_type(param)
{
	return 0;
}